package com.example.demo5072.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Data
@Entity
@Table(name = "user")
@TableName("user")
public class User {


    /**
     * mybatis plus实体类主键策略
     *
     * @TableId(type = IdType.AUTO)
     *
     * AUTO 数据库ID自增
     * INPUT 用户输入ID
     * ID_WORKER 全局唯一ID，Long类型的主键
     * ID_WORKER_STR 字符串全局唯一ID
     * UUID 全局唯一ID，UUID类型的主键
     * NONE 该类型为未设置主键类型
     */

    @Id
    @TableId(type = IdType.AUTO)
    private int id;

    private String uid;

    private String pwd;


    public User(int id, String uid, String pwd) {
        this.id = id;
        this.uid = uid;
        this.pwd = pwd;
    }

    public User() {
    }
}
